aboutsummaryrefslogtreecommitdiff
path: root/src/routes/projects/[id]/+page.server.ts
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-09-07 22:31:23 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-09-07 22:31:23 +0200
commit992e40835af1600a0961ec2454fb78ff43aec3c6 (patch)
tree3c0602ae64a186ce5ac51be6b0795037488f552a /src/routes/projects/[id]/+page.server.ts
parente4a158965f3fcfe6fac65a1eba7b456d615e7dca (diff)
Add routine archives: archive date, searchable archived list, frozen page
- Stamp archived_at on the archived snapshot; copy it on edit - loadArchived(projectId) + collapsible fuzzy-searched "Archivées" section on the project page - Archived routine pages open read-only with the health chart ending at the archive date; edit/complete actions reject archived routines
Diffstat (limited to 'src/routes/projects/[id]/+page.server.ts')
-rw-r--r--src/routes/projects/[id]/+page.server.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/routes/projects/[id]/+page.server.ts b/src/routes/projects/[id]/+page.server.ts
index e3c4edf..a23d834 100644
--- a/src/routes/projects/[id]/+page.server.ts
+++ b/src/routes/projects/[id]/+page.server.ts
@@ -6,6 +6,7 @@ import {
archive,
complete,
loadProjectDashboard,
+ loadArchived,
} from '$lib/server/services/routines';
import { numericId, parseFormString } from '$lib/server/services/validation';
import { parseIntervalToDays } from '$lib/shared/routine-metrics';
@@ -27,10 +28,12 @@ export const load: PageServerLoad = async ({ params }) => {
throw error(404, 'Projet introuvable');
}
const dashboard = await loadProjectDashboard(id, Date.now());
+ const archived = await loadArchived(id);
return {
project: { id: project.id, name: project.name },
routines: dashboard.routines,
healthScore: dashboard.healthScore,
+ archived,
};
};